﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;

public partial class AdminCMS_tab_Admin_Fix : System.Web.UI.Page
{
    int mid = 0;
   
    protected void Page_Load(object sender, EventArgs e)
    {
        UIMethod.GetQuery(ref mid, "id");
        if (!IsPostBack)
        {
            DataEntity.tab_Admin t = new DataEntity.tab_Admin();
            t.Select(mid);
            if (!t.IsEmpty)
            {
                txt_Answer.Text = t.adm_Answer.ToString();
                txt_Email.Text = t.adm_Email.ToString();
                txt_Question.Text = t.adm_Question.ToString();
                txt_RealName.Text = t.adm_RealName.ToString();
            }
            else { UIMethod.Close(); }
        }
    }

    protected void btn_submit_Click(object sender, EventArgs e)
    {
        DataEntity.tab_Admin t = new DataEntity.tab_Admin(true);        
        t.adm_RealName = Convert.ToString(txt_RealName.Text);
        t.adm_Question = Convert.ToString(txt_Question.Text);        
        t.adm_Email = Convert.ToString(txt_Email.Text);
        t.adm_Answer = Convert.ToString(txt_Answer.Text);
        t.Update(mid);

        StringBuilder sb = new StringBuilder();
        sb.Append("?ID=").Append(mid);
        UIMethod.Confirm("修改成功，继续修改吗？", "", "location = 'tab_Admin_List.aspx" + sb.ToString() + "';");
    }
}
